package com.xianniu.ltc.enums;

import lombok.Getter;

/**
 * @author wangruijie
 * @version 1.0
 * @description: < 售后类型 >
 * @date 2021/5/27 19:32
 */
@Getter
public enum AfterTypeEnum {
    // 售后类型
    TK(1,"019-0179a8acf73502a7"), // 仅退款
    HH(2,"019-0179a8ad43f302a9"), // 换货
    THTK(3,"019-0179a8acd97602a6"), // 退货退款
    TH(4,"019-0179a8ad324902a8"); // 仅退货


    private Integer key;
    private String value;

    AfterTypeEnum(Integer key, String value){
        this.key=key;
        this.value=value;
    }
    /**
     * 自己定义一个静态方法,通过key返回枚举常量对象
     * @param key
     * @return
     */
    public static AfterTypeEnum getValue(Integer key){

        for (AfterTypeEnum color: values()) {
            if(color.getKey().equals(key)){
                return  color;
            }
        }
        return null;
    }
}
